<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>tim</title>
</head>
<body>
    <script>
        function A () {

        }

        function B (a) {
            this.a=a;
        }

        function C (a) {
            if(a){
                this.a=a;
            }
        }

        A.prototype.a=1;
        B.prototype.a=1;
        C.prototype.a=1;

        console.log(new A());
        console.log(new B()); // 这个要注意  返回的是 {a: undefined}
        console.log(new C());
    
    
    </script>
</body>
</html>